﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace AjaxLibrary
{
    class example : IHttpHandler
    {
        bool IHttpHandler.IsReusable
        {
            get { return true; }
        }
         
        void IHttpHandler.ProcessRequest(HttpContext context)
        {
            string param = context.Request.QueryString["Param"];

            switch (param.ToLower())
            {
                case "date":
                    context.Response.Output.Write(DateTime.Now.Date.ToShortDateString());
                    return;
                case "time":
                    context.Response.Output.Write(DateTime.Now.ToShortTimeString());
                    return;
                case "host":
                    context.Response.Output.Write("请求的是Host");
                    return;

                default:
                    context.Response.Output.Write("Unknow request URL");
                    return;
            }


        }
    }
}
